package com.livepan.server.service;

import com.livepan.server.dataobject.UserPasswordDO;
import com.livepan.server.error.BusinessException;
import com.livepan.server.service.model.UserModel;

import java.util.List;
import java.util.Map;

/**
 * @author xuanqis
 */
public interface UserService {

    //通过用户id获取用户对象的方法
    UserModel getUserById(String id);

    //通过手机号得到用户对象
    UserModel getUserByTelePhone(String telephone) throws BusinessException;

    //用户注册
    void register(UserModel user, String ip) throws BusinessException;

    /**
     * 校验登录参数合法性
     *
     * @param telephone      电话号码
     * @param encrptPassword 加密后的密码
     */
    UserModel validateLogin(String telephone, String encrptPassword, String ip) throws BusinessException;

    List<Integer> getAllUserId();

    //设置email
    UserModel setEmail(String email, String userId) throws BusinessException;

    UserModel setAvatar(String avatarUrl, String userId) throws BusinessException;

    void logout(String userId, String ip);

    //得到用户的对应类型的登录记录
    List<Long> getUserLoginRecordList(String userId, Integer recordType);

    //更新用户的信息，只能更新基本的信息，密码和手机号等信息不应该通过这个进行更新
    UserModel updateUserInfo(UserModel userModel);

    List<UserModel> getUserList();

    Map<String,List<String>> getResourceMap(String userId);

    UserPasswordDO getUserPasswordDO(String userId);
}
